#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
const int N = 60, M = N * N;
int n, m;
int a[N];
int d[N];
int main()
{
	cin >> n >> m;
	while (m--) {
		int a, b;
		cin >> a >> b;
		d[b] ++;
	}
	int cnt = 0;
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		if (!d[i]) {
			cnt++;
			ans = i;
		}
	}
	if (cnt == 1)cout << ans << endl;
	else cout << -1 << endl;
	//int cnt = 0;
	//bool flag = 0;
	////sort(d + 1, d + n + 1);
	//for (int i = 1; i <= n; i++) {
	//	if (d[i] != cnt) {
	//		flag = 1;
	//		break;
	//	}
	//	cnt++;
	//}
	//if (flag)cout << -1 << endl;
	return 0;
}